<?php
/**
 * Created by zengwei.
 * Date: 2019/10/10
 * Time: 14:05
 * Function:
 */

if(!function_exists('dataFormat')){
    function dataFormat($msg='success',$data=null,$code=0){
        return [
            'msg'=>$msg,
            'data'=>$data,
            'code'=>$code,
            'time'=>time(),
        ];
    }
}

if(!function_exists('successDataFormat')){
    function successDataFormat($data=null,$msg='success'){
        return dataFormat($msg,$data,0);
    }
}

if(!function_exists('failDataFormat')){
    function failDataFormat($data=null,$msg='fail'){
        return dataFormat($msg,$data,1);
    }
}
